<?php 
include ( PATH . '/includes/common_header.php' );
include ( PATH . '/templates/' . $cookie_template . '/tables.php'); 

if (isset($initiate_maps) && $initiate_maps == 'ON')
{
 include(PATH . '/includes/functions/maps.php');
 $map = new Map();
 //$map->setAPIKey($conf['google_key']);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="<?php echo $lang['Direction']; ?>">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['Encoding']; ?>" />
 <meta http-equiv="Content-Style-Type" content="text/css" />
 <meta name="author" content="phpMyRealty.com" />
 <meta name="copyright" content="Copyright, phpMyRealty.com. All rights reserved." />

 <meta name="title" content="<?php if (isset($meta_title)) echo $meta_title; else echo $conf['title_meta']; ?>" />
 <meta name="description" content="<?php if (isset($meta_description)) echo $meta_description; else echo $conf['description_meta']; ?>" />
 <meta name="keywords" content="<?php if (isset($meta_keywords)) echo $meta_keywords; else echo $conf['keywords_meta']; ?>" />

 <meta name="robots" content="<?php echo $conf['robots_meta']; ?>" />
 <meta name="revisit-after" content="7 days" />
 <link rel="stylesheet" href="<?php echo URL . '/templates/' . $cookie_template . '/styles.css'; ?>" type="text/css" />
 <!--[if lt IE 9]><link rel="stylesheet" media="all" type="text/css" href="<?php echo URL . '/templates/' . $cookie_template . '/ie.css'; ?>" /><![endif]-->
 <link rel="stylesheet" href="<?php echo URL . '/templates/' . $cookie_template . '/tabcontent.css'; ?>" type="text/css" />
 <link rel="stylesheet" href="<?php echo URL; ?>/includes/lightbox/css/lightbox.css" type="text/css" />
 <link rel="stylesheet" href="<?php echo URL; ?>/includes/dhonishow/dhonishow.css" type="text/css" media="screen" />
 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo URL . '/rss.php'; ?>" />
<link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Francois+One' rel='stylesheet' type='text/css'>
<?php
 include ( PATH . '/includes/js.php' );
 if (isset($initiate_maps) && $initiate_maps == 'ON') {
   $map->printGoogleJS();
 }
 if (isset($initAjax) && $initAjax)
  $xajax->printJavascript(); 
?>
 <title><?php echo $title; ?></title>
</head>
<body <?php if (isset($onload)) echo $onload; ?>>
	<div class="wrapper">
		<div id="header">
			<h1 class="logo"><a href="<?php echo URL; ?>"><?php echo $conf['website_name_short'];?></a></h1>
			<div class="holder">
				<div class="top">
					<div class="login-box">
						<ul class="login-list">
						
						<?php
						
						// If Logged In
						if (auth_check($session->fetch('login'), $session->fetch('password')))
						{
							$user_name = $session->fetch('login');
													
							$user_url = '<li class="login"><a href="' . URL . '/index.php?req=logout">' . $lang['Realtor_Logout'] . '</a></li>';
						}
						else
						{
							// Guest
							$user_name = 'guest';
							
							$user_url = '<li class="login"><a href="';
							
							if ($conf['rewrite'] == 'ON')
							{ 
								$user_url .= URL . '/login.html';
							} 
							else 
							{ 
								$user_url .= URL . '/login.php'; 
							}
							
							$user_url .= '">' . $lang['Realtor_Login'] . '</a></li>';
						}
											
						?>
						
							<li><a href="#">welcome, <?php echo $user_name; ?>!</a></li>
							<?php echo $user_url; ?>
						</ul>
					</div>
					<span class="date"><?php echo date("F d, Y");?></span>
                                        <span class="date">  
                                                <?php
                                                // If settings box is enabled
                                                 if ($conf['settings_box'] == 'ON')
                                                 include (PATH . '/options_lang.php');?>
                                        </span>

				</div>
				<div class="nav-box">
					<ul class="nav">
					
					<?php
					
					switch ( $page )
					{
						case 'index':
							$link1 = ' class="active" ';
						break;
						
						case 'search':
							$link2 = ' class="active" ';
						break;
						
						case 'register':
							$link3 = ' class="active" ';
						break;
						
						case 'contact':
							$link4 = ' class="active" ';
						break;
						
						default:
							$link1 = ' class="active" ';
					}
					
					?>
					
						<li <?php echo $link1; ?>><a href="<?php echo URL; ?>"><?php echo $lang['Menu_Home']; ?></a></li>
						<li <?php echo $link2; ?>><a href="<?php echo URL; ?>/advsearchform.php"><?php echo $lang['Menu_Search']; ?></a></li>
						<li <?php echo $link3; ?>><a href="<?php echo URL; ?>/submit.php"><?php echo $lang['Realtor_Submit']; ?></a></li>
						<li <?php echo $link4; ?>><a href="<?php echo URL . '/mail.php'; ?>"><?php echo $lang['Menu_Contact_Us']; ?></a></li>
					</ul>
				</div>
			</div>
		</div><!-- header end -->
		<div id="main">
		
		<?php
		
		include PATH . '/box-slideshow-header.php';
		
		?>
			
			<div class="over">
				<div class="content">